package com.by.controller;

import com.by.bean.PageBean;
import com.by.bean.ResultBean;
import com.by.query.ProductCategoryQuery;
import com.by.service.ProductCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :LYJ
 * @version : 1.0
 * @date : 2025/2/26 14:51
 * @desc :
 * @since : JDK17
 */
@RestController
@RequestMapping("/api")
@Api(tags = "产品分类")
public class ProductCategoryController extends BaseController {
    @Autowired
    ProductCategoryService productCategoryService;

    /**
     * 产品分类查询
     *
     * @param productCategoryQuery
     * @return
     */
    @ApiOperation("产品分类查询")
    @PostMapping("/category/query")
    public ResultBean queryAll(@RequestBody ProductCategoryQuery productCategoryQuery) {
        PageBean pageBean = productCategoryService.queryAll(productCategoryQuery);
        return success("查询成功", pageBean);
    }

}
